import { ref, onMounted, onUnmounted } from "vue";
import { useI18n } from "vue-i18n";

const LangConversion = () => {
  const { t } = useI18n(); // 获取 vue-i18n 的 locale 响应式属性
  const descriptionMap = {
    推荐奖: "rewards",
    见点奖: "Seereward",
    对碰奖: "Matchrewards",
    感恩奖: "Gratefulreward",
    业绩奖: "Performance",
    间推奖: "Indirect",
    英语: "en",
    中文: "zh",
    日语: "ja",
    俄语: "ru",
    泰语: "th",
    马来语: "mys",
    购买: "buy",
    提币: "withdrawal",
    充值: "recharge",
    直推: "direct",
    节点: "nodes",
  };
  const getTranslation = (description) => {
    const translationKey = descriptionMap[description];
    return translationKey ? t(translationKey) : description;
    console.log(translationKey);
  };

  return {
    getTranslation,
  };
};

export default LangConversion;
